package com.hw01.common;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;

/**
 * MybatisPlus 配置
 **/
@Configuration
public class MybatisPlusConfigure {

    @Bean
    public MybatisPlusInterceptor plugins() {
        MybatisPlusInterceptor mpi = new MybatisPlusInterceptor();
        // 分页拦截器
        mpi.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));

        return mpi;
    }

}
